package com.deli.dubbo.mapper;

import com.deli.cache.entity.Employee;
import org.apache.ibatis.annotations.*;

import java.util.Map;

/**
 * @Description:
 * @Author: xudeli
 * @CreateDate: 2018/9/18 16:35
 **/
@Mapper
public interface EmployeeMapper {

    @Select("SELECT * FROM EMPLOYEE WHERE ID = #{id}")
    public Employee selectById(Integer id);

    @Update("update employee set lastName=#{lastName},email=#{email},gender=#{gender},dId=#{dId} where id = #{id}")
    public int updateEmp(Employee employee);

    @Delete("delete from employee where id = #{id}")
    public int deleteEmp(Integer id);

    @Insert("insert into employee(id,lastName,gender,email,dId) values(#{id},#{lastName},#{gender},#{email},#{dId})")
    public int insertEmp(Employee employee);

    @Select("select count(*) as tt from employee")
    public Map<String,Long> countEmp();
}
